package com.org.entity.sys;

import com.org.entity.base.BaseEntity;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.persistence.Column;
import javax.persistence.Table;
import javax.persistence.Transient;
import javax.validation.constraints.NotBlank;
import java.util.Date;

/**
 * 部门实体
 *
 * @author ghh
 * 2019-6-29 09:02:21
 */
@Data
@Table(name = "SYS_DEPARTMENT")
public class SysDept extends BaseEntity {

    /**
     * 部门编码
     */
    @Column(name = "CODE")
    @Length(min = 0,max = 64,message = "部门编码不能超过64")
    @NotBlank(message = "部门编码不能为空！")
    private String code;

    /**
     * 部门名称
     */
    @Column(name = "NAME")
    @NotBlank(message = "部门名称不能为空！")
    private String name;

    /**
     * 部门类型编码
     */
    @Column(name = "FK_DEPT_TYPE_CODE")
    @NotBlank(message = "部门类型编码不能为空！")
    private String fkDeptTypeCode;

    /**
     * 部门类型名称
     */
    @Transient
    private String deptTypeName;

    /**
     * 部门详情
     */
    @Column(name = "DESCR")
    private String descr;

    /**
     * 状态
     */
    @Column(name = "STATE")
    private int state;

    /**
     * 创建时间
     */
    @Column(name = "ADD_TIME")
    private Date addTime;

    /**
     * 创建人
     */
    @Column(name = "ADD_USER_ID")
    private String addUserId;

}


